import request from '~/utils/resquest'

// 巡视设置列表
export const getPatrolConfigList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolConfig/list', method: 'GET', params })
}

// 巡视设置列表-查询巡视主体
export const getPatrolModule = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolConfig/getPatrolModule', method: 'GET', params })
}

// 巡视设置列表-编辑
export const getPatrolConfigUpdateList = <T>(data: T) => {
  return request({ url: '/api/gxsaas-produce/patrolConfig/update', method: 'POST', data })
}

// 巡视设置列表-新增
export const getPatrolConfigAddList = <T>(data: T) => {
  return request({ url: '/api/gxsaas-produce/patrolConfig/add', method: 'POST', data })
}

// 巡视计划列表
export const getPatrolGroupList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolGroup/list', method: 'GET', params })
}

// 巡视计划列表-删除
export const getPatrolGroupRemoveList = <T>(data: T) => {
  return request({ url: `/api/gxsaas-produce/patrolGroup/remove?ids=${data}`, method: 'POST' })
}

// 巡视计划列表-查询负责人
export const getPatrolHandleUser = <T>(params: T) => {
  return request({
    url: '/api/gxsaas-produce/patrolGroup/getPatrolHandleUser',
    method: 'GET',
    params
  })
}

// 巡视任务列表
export const getPatrolTaskList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolTask/list', method: 'GET', params })
}

// 巡视任务列表-详情
export const patrolTaskView = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolTask/view', method: 'GET', params })
}

// 巡视任务列表-删除
export const getPatrolTaskRemoveList = <T>(data: T) => {
  return request({ url: `/api/gxsaas-produce/patrolTask/remove?ids=${data}`, method: 'POST' })
}

// 巡视字段
export const getDictionary = <T>(data: T) => {
  return request({ url: `/api/gxsaas-system/dict/dictionary?code=${data}`, method: 'GET' })
}

// 巡视计划列表-台区
export const getSllAssetPage = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolGroup/allAssetPage', method: 'GET', params })
}

// 巡视计划列表-巡视类型
export const getConfigList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolConfig/configList', method: 'GET', params })
}

// 巡视计划列表-修改
export const patrolGroupSave = <T>(data: T) => {
  return request({ url: '/api/gxsaas-produce/patrolGroup/save', method: 'POST', data })
}

// 巡视计划列表-新增
export const patrolGroupAdd = <T>(data: T) => {
  return request({ url: '/api/gxsaas-produce/patrolGroup/add', method: 'POST', data })
}

// 巡视计划列表-详情
export const patrolGroupView = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolGroup/view', method: 'GET', params })
}

// 巡视计划列表-根据配置生成最近5次任务生成周期
export const generateCycle = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolConfig/generateCycle', method: 'GET', params })
}
// 巡视计划 - 道路巡视列表
export const getRoadList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-assets/street/list', method: 'GET', params })
}

// 巡视记录列表
export const getPatrolRecordList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolRecord/list', method: 'GET', params })
}

// 巡视记录列表-详情
export const patrolRecordView = <T>(params: T) => {
  return request({ url: '/api/gxsaas-produce/patrolRecord/view', method: 'GET', params })
}

// 巡视记录列表-所属工区
export const workareaSelectList = <T>(params: T) => {
  return request({ url: '/api/gxsaas-assets/workarea/selectList', method: 'GET', params })
}
